package table_Mixage;

/**
 *  Fragment 
 *  Description: un fragment est une serie de coordonnées
 *	
 *	Contenu:
 *		- création de fragment  (debut, durée, fin)
 *		
 *
 *
 * @author Peloux Arnaud</a>
 * @version 1.0
 */
public class Fragment {
	private long dateDebut,duree,dateFin;
	//Date en nombre d'echantillons
	
	public Fragment(long dateDebut, long duree){
		this.dateDebut=dateDebut;
		this.duree=duree;
		dateFin= this.dateDebut+this.duree;
	}

	public long getDateDebut(){return dateDebut;}
	public long getDuree(){return duree;}
	public long getDateFin(){return dateFin;}
	public void setDateDebut(long dateDebut){
		this.dateDebut=dateDebut;
		dateFin= this.dateDebut+this.duree;}
	public void setDuree(long duree){
		this.duree=duree;
		dateFin= this.dateDebut+this.duree;}	
	public void setDateFin(long dateFin){
	this.dateFin= dateFin;
	this.duree=this.dateFin-this.dateDebut;
	}
	public String toString(){
	   	 return (" Debut Fragment: "+dateDebut
	   			 +" Fin Fragment: "+dateFin+" Duree: "+duree);
	}
	public boolean equals(Fragment f){
		return(f.duree == duree & f.dateDebut == dateDebut & f.dateFin == dateFin);
	}
}
